package com.hanhai.zrb.mobile.controller;

import java.io.IOException;
import java.util.List;

import javax.annotation.Resource;

import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.hanhai.common.annotation.LoginNeedless;
import com.hanhai.zrb.api.biz.service.IndustryService;
import com.hanhai.zrb.mobile.result.BaseApiResult;
import com.hanhai.zrb.model.project.Industry;

@LoginNeedless
@RestController
@RequestMapping("/industryApi")
public class IndustryApiController {

	@Resource
	private IndustryService industryService;

	/**
	 * App页面获取行业类型
	 * 
	 * @param response
	 * @return
	 * @throws IOException
	 */

	@RequestMapping("/findAllIndustry")
	public BaseApiResult findAllIndustry(String type) {
		List<Industry> list = industryService.selectAll();
		BaseApiResult result = new BaseApiResult();
		if (StringUtils.isNotBlank(type)) {
			list.remove(0);
		}
		result.setData(list);
		return result;
	}

}
